<%@ include file="/jsp/common.jsp" %>
<%@ page  language="java" import="java.util.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<head>
<link rel="stylesheet" type="text/css" href="../css/base_button.css"/>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<style>
tr{ height:4em;}
td{text-align:right;}
</style>
</head>
<body>
	<div>
	<form id="newForm" method="post" action="">
		<table style="width:80%;table-layout:fixed;">
			<tr>
				<td width="15%;">学校</td>
				<td>
					<input type="text" name="studentName" id="studentName" />
				</td>
				<td width="15%;">班级</td>
				<td>
					<input type="text" name="studentName" id="studentName" />
				</td>
				<td width="15%;">姓名</td>
				<td>
					<input type="text" name="studentName" id="studentName" />
				</td>
			</tr>
			<tr>
				<td colspan="6" style="text-align:center;">
					<input type="button"  class="button_sub01" value="查询" onclick="submit();"/>
				</td>
			</tr>
		</table>
	</form>
	</div>
	
	<div>
		<iframe id="showContent" name="showContent" width="100%" height="100%" style="border:none;scrolling:none;" ></iframe>
	</div>
<script>
	function submit(){
		var formData = $("#newForm").serialize();
		$.ajax({
			url:"addStudent.do",
			type:"POST",
			data: decodeURIComponent(formData,true),
			async:false,
			dataType:"json",
			success:function(data){
				var retCode = data['resCode'];
				if(retCode=='1'){
					alert("保存成功");
					location.href="student.do" ;
				}else if(retCode=='2'){
					alert("保存失败");
					return;
				}
			},
			error:function(data){
				console.log("处理失败了");
			}
		});
		
	}
</script>

</body>